import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooAppAccessTokenController } from '../../../controllers';
const uctooappAccessTokenRouter = new Router();
const appAccessTokenController = new uctooAppAccessTokenController();

uctooappAccessTokenRouter.post('/add', requireUser, appAccessTokenController.add);
uctooappAccessTokenRouter.post('/edit', requireUser, rowLevelPermission('uctoo/app_access_token'), appAccessTokenController.edit);
uctooappAccessTokenRouter.post('/del', requireUser, rowLevelPermission('uctoo/app_access_token'), appAccessTokenController.delete);

//For getting appAccessToken with permission control
uctooappAccessTokenRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/app_access_token'), appAccessTokenController.getSingle);
uctooappAccessTokenRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/app_access_token'), appAccessTokenController.getMany);
uctooappAccessTokenRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/app_access_token'), appAccessTokenController.getMany);

//#endregion AutoCreateCode
export default uctooappAccessTokenRouter;
